#include<bits/stdc++.h>
using namespace std;
signed main() {
	int s, v;
	scanf("%d%d", &s, &v);
	int tar = 8 * 60 - 10;
	int t = ceil(1.0 * s / v);
	if (t <= tar)
		printf("%02d:%02d", (tar - t) / 60, (tar - t) % 60);
	else
		printf("%02d:%02d", 23 - (t - tar) / 60, 60 - (t - tar) % 60);
	return 0;
}
